package com.huiminpay.test.rocketmq.message;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * @ClassName : ConsumerSimple
 * @Author : 阿泽
 * @Date: 2021/8/17 12:19
 * @Description :
 */
@Component
@RocketMQMessageListener(topic = "my-topic",consumerGroup = "demo-consumer-group")
public class ConsumerSimple implements RocketMQListener<String> {

    //得到消息
    @Override
    public void onMessage(String msg) {
        //此方法表示接收到消息  msg就是消息内容
        //处理消息
        System.out.println(msg);
    }
}
